package com.woniu.car.controller;

import com.woniu.bean.R;
import com.woniu.car.bean.TCarType;
import com.woniu.car.service.ITCarTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author kk
 * @since 2022-08-09
 */
@RestController
@RequestMapping("/carType")
@CrossOrigin
public class TCarTypeController {
    @Autowired
    private ITCarTypeService carTypeService;

    @GetMapping
    public R selectAll(){
        List<TCarType> list = carTypeService.list();
        R r =R.OK();
        r.setData(list);
//        System.out.println(r);
        return r;
    }


}
